 $(document).ready(function(){ 
	$('#UserHomepageForm').submit(function(event) {
		event.preventDefault();
		var dataString = $("#UserHomepageForm").serialize();
		$.jGrowl('Please wait while we process your request');

		$.ajax({
			url: webroot + 'users/register', 
			type: 'POST',
			cache: false,
			dataType: "json",
			data: dataString,
			success: function(message) {
				if (message.status == 'success') {
					$.jGrowl(message.message, {sticky: true});
			        $("#register_box").css("visibility","hidden");
			        $("#dim_block").css("visibility","hidden");
				} else {
					$.jGrowl(message.message);
				}
			}
		});
		return false;
	});
});
